Integrand size = 21, antiderivative size = 57 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\frac {(a+b)^2 \log (\cosh (c+d x))}{d}-\frac {b (a+b) \tanh ^2(c+d x)}{2 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^2}{4 d} \]
[Out]
Time = 0.06 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3751, 455, 45} \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=-\frac {b (a+b) \tanh ^2(c+d x)}{2 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^2}{4 d}+\frac {(a+b)^2 \log (\cosh (c+d x))}{d} \]
[In]
[Out]
Rule 45
Rule 455
Rule 3751
Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {x \left (a+b x^2\right )^2}{1-x^2} \, dx,x,\tanh (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \frac {(a+b x)^2}{1-x} \, dx,x,\tanh ^2(c+d x)\right )}{2 d} \\ & = \frac {\text {Subst}\left (\int \left (-b (a+b)+\frac {(a+b)^2}{1-x}-b (a+b x)\right ) \, dx,x,\tanh ^2(c+d x)\right )}{2 d} \\ & = \frac {(a+b)^2 \log (\cosh (c+d x))}{d}-\frac {b (a+b) \tanh ^2(c+d x)}{2 d}-\frac {\left (a+b \tanh ^2(c+d x)\right )^2}{4 d} \\ \end{align*}
Time = 0.37 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.88 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=-\frac {-4 (a+b)^2 \log (\cosh (c+d x))+2 b (2 a+b) \tanh ^2(c+d x)+b^2 \tanh ^4(c+d x)}{4 d} \]
[In]
[Out]
Time = 0.10 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.61
method | result | size |
derivativedivides | \(\frac {-\frac {\tanh \left (d x +c \right )^{4} b^{2}}{4}-\tanh \left (d x +c \right )^{2} a b -\frac {b^{2} \tanh \left (d x +c \right )^{2}}{2}-\frac {\left (a^{2}+2 a b +b^{2}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (-a^{2}-2 a b -b^{2}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(92\) |
default | \(\frac {-\frac {\tanh \left (d x +c \right )^{4} b^{2}}{4}-\tanh \left (d x +c \right )^{2} a b -\frac {b^{2} \tanh \left (d x +c \right )^{2}}{2}-\frac {\left (a^{2}+2 a b +b^{2}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (-a^{2}-2 a b -b^{2}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) | \(92\) |
parts | \(\frac {a^{2} \ln \left (\cosh \left (d x +c \right )\right )}{d}+\frac {b^{2} \left (-\frac {\tanh \left (d x +c \right )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {2 a b \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}\) | \(106\) |
parallelrisch | \(-\frac {\tanh \left (d x +c \right )^{4} b^{2}+4 a^{2} d x +8 a b d x +4 b^{2} d x +4 \tanh \left (d x +c \right )^{2} a b +2 b^{2} \tanh \left (d x +c \right )^{2}+4 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{2}+8 \ln \left (1-\tanh \left (d x +c \right )\right ) a b +4 \ln \left (1-\tanh \left (d x +c \right )\right ) b^{2}}{4 d}\) | \(111\) |
risch | \(-a^{2} x -2 a b x -b^{2} x -\frac {2 a^{2} c}{d}-\frac {4 a b c}{d}-\frac {2 c \,b^{2}}{d}+\frac {4 b \,{\mathrm e}^{2 d x +2 c} \left (a \,{\mathrm e}^{4 d x +4 c}+b \,{\mathrm e}^{4 d x +4 c}+2 \,{\mathrm e}^{2 d x +2 c} a +b \,{\mathrm e}^{2 d x +2 c}+a +b \right )}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{4}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}+\frac {2 a b \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) b^{2}}{d}\) | \(178\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1638 vs. \(2 (53) = 106\).
Time = 0.28 (sec) , antiderivative size = 1638, normalized size of antiderivative = 28.74 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\text {Too large to display} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 122 vs. \(2 (48) = 96\).
Time = 0.13 (sec) , antiderivative size = 122, normalized size of antiderivative = 2.14 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=\begin {cases} a^{2} x - \frac {a^{2} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} + 2 a b x - \frac {2 a b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a b \tanh ^{2}{\left (c + d x \right )}}{d} + b^{2} x - \frac {b^{2} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b^{2} \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {b^{2} \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right )^{2} \tanh {\left (c \right )} & \text {otherwise} \end {cases} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 186 vs. \(2 (53) = 106\).
Time = 0.28 (sec) , antiderivative size = 186, normalized size of antiderivative = 3.26 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=b^{2} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {4 \, {\left (e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}{d {\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} + 2 \, a b {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + \frac {a^{2} \log \left (\cosh \left (d x + c\right )\right )}{d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 116 vs. \(2 (53) = 106\).
Time = 0.33 (sec) , antiderivative size = 116, normalized size of antiderivative = 2.04 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=-\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} {\left (d x + c\right )} - {\left (a^{2} + 2 \, a b + b^{2}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - \frac {4 \, {\left ({\left (a b + b^{2}\right )} e^{\left (6 \, d x + 6 \, c\right )} + {\left (2 \, a b + b^{2}\right )} e^{\left (4 \, d x + 4 \, c\right )} + {\left (a b + b^{2}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{4}}}{d} \]
[In]
[Out]
Time = 1.83 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.33 \[ \int \tanh (c+d x) \left (a+b \tanh ^2(c+d x)\right )^2 \, dx=x\,\left (a^2+2\,a\,b+b^2\right )-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^2\,\left (b^2+2\,a\,b\right )}{2\,d}-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (a^2+2\,a\,b+b^2\right )}{d}-\frac {b^2\,{\mathrm {tanh}\left (c+d\,x\right )}^4}{4\,d} \]
[In]
[Out]